/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.validator;

import com.minierp.model.EstablishmentType;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

public class EstablishmentTypeValidator implements Validator {
	public boolean supports(Class clazz) {
		return EstablishmentType.class.isAssignableFrom(clazz);
	}

	public void validate(Object obj, Errors errors) {
		EstablishmentType form = (EstablishmentType) obj;
		if (form.getTypeName() == null || form.getTypeName().trim().equals("")) {
			errors.rejectValue("typeName", "", "请输入『名称』");
		}

	}
}